package com.wxzhou.wangzhuan.entity;


import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDateTime;

/**
 * api部分用户信息
 */
public class SysUser {


    /**
     * 主键ID
     */
    private Long id;

    //是否允许提现：1是,2否
    private Boolean is_withdrawal;

    //昵称
    private String nick_name;

    //设备ID
    private String device_id;

    //渠道
    private String channel;

    private String phone;

    //微信号
    private String wechat;

    //微信二维码
    private String wechat_qrcode;

    private Integer level;

    //账户创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime created_at;

    public SysUser() {
    }

    private SysUser(String device_id, String channel) {
        this.device_id = device_id;
        this.channel = channel;
    }

    public static SysUser createByDevice(String device_id, String channel) {
        return new SysUser(device_id, channel);
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Boolean getIs_withdrawal() {
        return is_withdrawal;
    }

    public void setIs_withdrawal(Boolean is_withdrawal) {
        this.is_withdrawal = is_withdrawal;
    }

    public String getNick_name() {
        return nick_name;
    }

    public void setNick_name(String nick_name) {
        this.nick_name = nick_name;
    }

    public String getDevice_id() {
        return device_id;
    }

    public void setDevice_id(String device_id) {
        this.device_id = device_id;
    }

    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getWechat() {
        return wechat;
    }

    public void setWechat(String wechat) {
        this.wechat = wechat;
    }

    public String getWechat_qrcode() {
        return wechat_qrcode;
    }

    public void setWechat_qrcode(String wechat_qrcode) {
        this.wechat_qrcode = wechat_qrcode;
    }

    public LocalDateTime getCreated_at() {
        return created_at;
    }

    public void setCreated_at(LocalDateTime created_at) {
        this.created_at = created_at;
    }

    public Integer getLevel() {
        return level == null ? 1 : level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }
}
